-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow DevelopmentServer testing with internal and external plugins together #23100
base: master
Are you sure you want to change the base?
Allow DevelopmentServer testing with internal and external plugins together #23100
Conversation
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
Closing this pull request, as it has been stale for six weeks. Feel free to re-open at any time. |
I think this would be a great feature to add for developers. Reopened and added staleignore. I will try to review and help towards merge. |
23a0e5c
to
903aaff
Compare
Rebased! Should be ready for review again :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testing/trino-server-dev/src/main/java/io/trino/server/HybridDevelopmentPluginsProvider.java
Outdated
Show resolved
Hide resolved
629b15e
to
2c30807
Compare
Code looks good to me. Just need to get docs updated and do some testing. Anybody else wants to chime in about their testing of this or other aspects @nineinchnick @martint @electrum ? |
85f200a
to
8379005
Compare
Can you squash commits @xkrogen ? |
…gether Co-authored-by: Pratham Desai <[email protected]>
8379005
to
b1e718d
Compare
I thought the point of the Anyway I have squashed, just want to better understand this for next time. |
@@ -34,3 +34,7 @@ product-test-reports | |||
**/dependency-reduced-pom.xml | |||
core/trino-web-ui/src/main/resources/webapp/dist/ | |||
.node | |||
|
|||
# Local plugins added for testing should be excluded | |||
testing/trino-server-dev/etc/plugin/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this redundant with testing/trino-server-dev/etc/plugin/.gitignore
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! This was added before I added the nested .gitignore
. Thanks for catching it.
@Override | ||
public void loadPlugins(Loader loader, ClassLoaderFactory createClassLoader) | ||
{ | ||
developmentPluginsProvider.loadPlugins(loader, createClassLoader); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ok to me, but I wonder if we can improve the developer experience here. Coping plugins is one extra step that could be avoided - if the DevelopmentPluginsProvider
was able to load a plugin from a directory, then we could add directories to the plugin.bundles
list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm I see what you're saying. Currently, plugins.bundle
supports pom.xml
/*.pom
files as well as Maven coordinates, and we could also add support for directories. It's a good idea! I can take a look at this.
Description
This PR makes it possible to use the local
DevelopmentServer
with both "internal" plugins (those within thetrino
repo) as well as "external" plugins that originate from outside of the repository. A newHybridDevelopmentPluginsProvider
is added which loads plugins both fromplugin.dir
and fromplugin.bundles
, and this is now used by default inDevelopmentServer
. No additional plugins are loaded by default, but any plugin directories dropped intotesting/trino-server-dev/etc/plugin
will be picked up automatically.For now this is added as an entirely new
PluginsProvider
which combines the behavior of the development and server plugins providers, but I would also be happy to structure it such thatDevelopmentPluginsProvider
just does this internally (by delegating toServerPluginsProvider
). Feedback is welcomed.Additional context and related issues
In #6834, the whole dev server was refactored. Previously, it was possible to use
plugin.dir
as well asplugin.bundles
simultaneously, but after the refactor, these were moved to two separate plugin loaders (ServerPluginsProvider
andDevelopmentPluginsProviders
, respectively).DevelopmentServer
only usesDevelopmentPluginsProvider
, so it can load plugins from POM, but cannot load plugins from a directory, making it challenging to leverage theDevelopmentServer
to test other plugins. This can be really useful while working on third party plugins that live outside of the Trino repo, and in particular, to test interactions between plugins, such as redirection, or inspecting the events received by a third-party event listener when working with an internal catalog.Release notes
(X) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: